/* @flow */
'use strict';

var React = require('react-native');

var {
	StyleSheet,
	View,
	SliderIOS,
	Text
} = React;

var SliderIOSView = React.createClass({


	getInitialState: function() {
		return {
			value: 0
		};
	},

	changeValue: function(value) {
		console.log(value);
		this.setState({
			value: value
		});
	},

	render: function() {
		return (
			<View style={styles.content}>
				<SliderIOS 
					style={styles.sliderStyle} 
					value = {0}
					maximumValue = {100} 
					step={2}
					onValueChange = {this.changeValue}
				/>
				<Text>{'当前Value是===>'+this.state.value}</Text>
			</View>
		);
	}
});


var styles = StyleSheet.create({
	content: {
		flex: 1,
		marginTop: 64
	},
	sliderStyle: {
		marginTop: 20,
		marginLeft: 20
	}
});


module.exports = SliderIOSView;